import request from '@/utils/request'

export function PlanAndProductionList(params) {
  return request({
    url: `/PlanAndProduction/OrderManager/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function PlanAndProductionDelete(data) {
  return request({
    url: `/PlanAndProduction/OrderManager/DeleteOrder/OrderId=${data.OrderId}`,
    method: 'delete',
    data,
  })
}

export function StartOrderProcess(data) {
  return request({
    url: `/PlanAndProduction/OrderManager/StartOrderProcess/OrderId=${data.OrderId}`,
    method: 'post',
    data,
  })
}
// 工单队列获取
export function WorkorderInfoList(params) {
  return request({
    url: `/PlanAndProduction/ProductMonitor/WorkorderInfoList/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}
// 工单生产队列 详情获取
export function WorkorderProduceQueue(params) {
  return request({
    url: `/PlanAndProduction/ProductMonitor/WorkorderProduceQueue/OrderId=${params.OrderId}`,
    method: 'get',
    params,
  })
}
export function OrderManagerList(params) {
  return request({
    url: `/PlanAndProduction/OrderManager/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function DeleteOrderDelete(data) {
  return request({
    url: `/PlanAndProduction/OrderManager/DeleteOrder/OrderId=${data.OrderId}`,
    method: 'delete',
    data,
  })
}

export function GetProduction(params) {
  return request({
    url: `/PlanAndProduction/OrderManager/GetProduction`,
    method: 'get',
    params,
  })
}

export function GetDetectTion(params) {
  return request({
    url: `/PlanAndProduction/OrderManager/GetDetectTion`,
    method: 'get',
    params,
  })
}

export function GetDetectAction(params) {
  return request({
    url: `/PlanAndProduction/OrderManager/GetDetectAction`,
    method: 'get',
    params,
  })
}

export function PlanAndProductionAdd(data) {
  return request({
    url: '/PlanAndProduction/OrderManager/Newly/',
    method: 'post',
    data,
  })
}

export function FlowChartOptions(params) {
  return request({
    url: `/PlanAndProduction/OrderManager/FlowChartOptions/`,
    method: 'get',
    params,
  })
}

export function FlowChart(params) {
  return request({
    url: `/PlanAndProduction/OrderManager/FlowChart/OrderId=${params.OrderId}`,
    method: 'get',
    params,
  })
}

export function FlowCharts(data) {
  return request({
    url: `/PlanAndProduction/OrderManager/FlowChart/OrderId=${data.OrderId}`,
    method: 'post',
    data,
  })
}

export function MonthPlanList(params) {
  return request({
    url: `/PlanAndProduction/ProductMonitor/MonthPlanList/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function DeviceInfoList(params) {
  return request({
    url: `/PlanAndProduction/ProductMonitor/DeviceInfoList/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}
//设备生产日志信息获取
export function DeviceLog() {
  return request({
    url: `/PlanAndProduction/ProductMonitor/WorkorderInfoList/DeviceLog`,
    method: 'get',
  })
}

export function OrderList(params) {
  return request({
    url: `/PlanAndProduction/ProductMonitor/OrderList/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function planOrderList(params) {
  return request({
    url: `/PlanAndProduction/ProducePlan/OrderList/ProduceOrderId=${params.ProduceOrderId}`,
    method: 'get',
    params,
  })
}

export function ProduceOrderIdList(params) {
  return request({
    url: `/PlanAndProduction/ProducePlan/ProduceOrderIdList/`,
    method: 'get',
    params,
  })
}

export function AllProductPlanInfo(params) {
  return request({
    url: `/PlanAndProduction/ProducePlan/ProductList/AllProductPlanInfo/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function produceOrderList(params) {
  return request({
    url: `/PlanAndProduction/ProduceOrder/OrderList/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function ProducePlanGet(params) {
  return request({
    url: `/PlanAndProduction/ProducePlan/ProduceOrderId=${params.ProduceOrderId}`,
    method: 'get',
    params,
  })
}

export function ProducePlanDel(data) {
  return request({
    url: `/PlanAndProduction/ProducePlan/ProductList/Product/PlanId=${data.PlanId}`,
    method: 'delete',
    data,
  })
}

export function ProducePlanOrderNewly(data) {
  return request({
    url: `/PlanAndProduction/ProducePlan/OrderNewly/ProduceOrderId/ProduceOrderId=${data.ProduceOrderId}&ProductId=${data.ProductId}`,
    method: 'post',
    data,
  })
}

export function ProducePlanUpdateProduct(data) {
  return request({
    url: `/PlanAndProduction/ProducePlan/ProductList/UpdateProduct/PlanId=${data.PlanId}`,
    method: 'post',
    data,
  })
}

export function GenerateProduct(data) {
  return request({
    url: `/PlanAndProduction/ProducePlan/ProductList/GenerateProduct/PlanId=${data.PlanId}`,
    method: 'post',
    data,
  })
}

export function ProducePlan(data) {
  return request({
    url: `/PlanAndProduction/ProducePlan/OrderNewly`,
    method: 'post',
    data,
  })
}

export function Scheduling(params) {
  return request({
    url: `/PlanAndProduction/OrderManager/Scheduling/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function SchedulingRule(data) {
  return request({
    url: `/PlanAndProduction/OrderManager/Scheduling/SchedulingRule/`,
    method: 'post',
    data,
  })
}

export function RenameOrder(data) {
  return request({
    url: `/PlanAndProduction/OrderManager/RenameOrder`,
    method: 'post',
    data,
  })
}

export function ProduceOrder(data) {
  return request({
    url: `/PlanAndProduction/ProduceOrder/OrderList/`,
    method: 'post',
    data,
  })
}

export function ProduceOrderDel(data) {
  return request({
    url: `/PlanAndProduction/ProduceOrder/OrderList/ProduceOrderId=${data.ProduceOrderId}`,
    method: 'delete',
    data,
  })
}

export function OrderDetail(params) {
  return request({
    url: `/PlanAndProduction/ProduceOrder/OrderDetail/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}
export function ProcessLog(params) {
  return request({
    url: `/PlanAndProduction/ProductMonitor/WorkorderProduceQueue/ProcessLog`,
    method: 'get',
    params,
  })
}

export function OrderManager(params) {
  return request({
    url: `/PlanAndProduction/OrderManager/Index=${params.Index}&Count=${params.Count}`,
    method: 'get',
    params,
  })
}

export function OrderInsertion(data) {
  return request({
    url: `/PlanAndProduction/OrderManager/OrderInsertion`,
    method: 'post',
    data,
  })
}
//工单暂停和恢复
export function OrderPauseOrCancel(params) {
  return request({
    url: `/PlanAndProduction/ProductMonitor/OrderPauseOrCancel/OrderId=${params.OrderId}&PauseOrCancel=${params.PauseOrCancel}`,
    method: 'get',
    params,
  })
}
//工单取消
export function OrderCancellation(params) {
  return request({
    url: `/PlanAndProduction/ProductMonitor/OrderCancellation/OrderId=${params.OrderId}`,
    method: 'get',
    params,
  })
}

export function Mark(data) {
  return request({
    url: `/PlanAndProduction/OrderManager/Mark `,
    method: 'post',
    data,
  })
}

export function PartInfo(params) {
  return request({
    url: `/PlanAndProduction/OrderManager/Scheduling/PartInfo/`,
    method: 'get',
    params,
  })
}

export function DeviceRunningRate(params) {
  return request({
    url: `/PlanAndProduction/OrderManager/Scheduling/DeviceRunningRate/`,
    method: 'get',
    params,
  })
}
